home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / disk / RCS / Disk.man,v < prev    next >
Encoding:
Text File  |  1992-08-31  |  23.4 KB  |  671 lines

  1. head     1.8;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @@;
  7.  
  8.  
  9. 1.8
  10. date     92.08.31.12.20.45;  author voelker;  state Exp;
  11. branches ;
  12. next     1.7;
  13.  
  14. 1.7
  15. date     91.10.07.17.41.16;  author voelker;  state Exp;
  16. branches ;
  17. next     1.6;
  18.  
  19. 1.6
  20. date     91.09.14.15.17.15;  author mendel;  state Exp;
  21. branches ;
  22. next     1.5;
  23.  
  24. 1.5
  25. date     90.03.18.12.54.01;  author jhh;  state Exp;
  26. branches ;
  27. next     1.4;
  28.  
  29. 1.4
  30. date     90.02.16.16.08.51;  author shirriff;  state Exp;
  31. branches ;
  32. next     1.3;
  33.  
  34. 1.3
  35. date     90.01.31.17.06.03;  author jhh;  state Exp;
  36. branches ;
  37. next     1.2;
  38.  
  39. 1.2
  40. date     89.09.25.12.32.41;  author jhh;  state Exp;
  41. branches ;
  42. next     1.1;
  43.  
  44. 1.1
  45. date     89.02.09.11.14.09;  author brent;  state Exp;
  46. branches ;
  47. next     ;
  48.  
  49.  
  50. desc
  51. @Disk package man page
  52. @
  53.  
  54.  
  55. 1.8
  56. log
  57. @lfs routines. checked in by jhh
  58. @
  59. text
  60. @'\" Copyright 1989 Regents of the University of California
  61. '\" Permission to use, copy, modify, and distribute this
  62. '\" documentation for any purpose and without fee is hereby
  63. '\" granted, provided that this notice appears in all copies.
  64. '\" The University of California makes no representations about
  65. '\" the suitability of this material for any purpose.  It is
  66. '\" provided "as is" without express or implied warranty.
  67. '\" 
  68. '\" $Header: /sprite/src/lib/disk/RCS/Disk.man,v 1.7 91/10/07 17:41:16 voelker Exp Locker: voelker $ SPRITE (Berkeley)
  69. '/" 
  70. .so \*(]ltmac.sprite
  71. .HS Disk lib
  72. .BS
  73. .SH NAME
  74. .VS
  75. Disk_ReadLabel, Disk_WriteLabel, Disk_EraseLabel, Disk_NewLabel, Disk_ReadDecLabel, Disk_WriteDecLabel, Disk_ReadSunLabel,  Disk_WriteSunLabel, Disk_HasFilesystem, Disk_ReadLfsSuperBlock, Disk_WriteLfsSuperBlock, Disk_ReadLfsCheckpointHdr, Disk_WriteLfsCheckPointHdr, Disk_WriteLfsCheckPointArea, Disk_LfsCheckpointTrailer, Disk_ForEachCheckpointRegion, Disk_ReadDomainHeader, Disk_WriteDomainHeader, Disk_ReadSummaryInfo, Disk_WriteSummaryInfo, Disk_SectorRead, Disk_SectorWrite, Disk_BlockRead, Disk_BlockWrite, Disk_BadBlockRead, Disk_FragRead, Disk_FragWrite, Disk_PrintDomainHeader, Disk_PrintSummaryInfo, Disk_PrintFileDescBitmap, Disk_PrintDataBlockBitmap, Disk_PrintDirEntry, Disk_PrintLabel, Disk_PrintLfsSuperBlock, Disk_PrintLfsSuperBlockHdr, Disk_PrintLfsDescMapParams, Disk_PrintLfsSegUsageParams, Disk_PrintLfsFileLayoutParams, Disk_PrintLfsStableMemParams, Disk_PrintLfsCheckpointHdr, Disk_PrintLfsCheckpointRegion, Disk_PrintLfsCheckpointTrailer 
  76. \- Package for accessing OFS and LFS file systems via raw disks
  77. .VE
  78. .SH SYNOPSIS
  79. .nf
  80. .VS
  81. #include <disk.h>
  82. .VE
  83. .VS
  84. Disk_Label *
  85. \fBDisk_ReadLabel\fR(\fIfileID\fR)
  86. int
  87. \fBDisk_WriteLabel\fR(\fIfileID, labelPtr\fR)
  88. Disk_Label *
  89. \fBDisk_NewLabel\fR(\fIlabelType\fR)
  90. int
  91. \fBDisk_EraseLabel\fR(\fIfileID, labelType\fR)
  92. .VE
  93. .VS
  94. Dec_DiskLabel *
  95. \fBDisk_ReadDecLabel\fR(\fIfileID\fR)
  96. int
  97. \fBDisk_WriteDecLabel\fR(\fIfileID, decLabelPtr\fR)
  98. .VE
  99. Sun_DiskLabel *
  100. \fBDisk_ReadSunLabel\fR(\fIfileID\fR)
  101. .VS
  102. int
  103. \fBDisk_WriteSunLabel\fR(\fIfileID, sunLabelPtr\fR)
  104. .VE
  105. .VS
  106. Ofs_DomainHeader *
  107. \fBDisk_ReadDomainHeader\fR(\fIfileID, labelPtr\fR)
  108. int
  109. \fBDisk_WriteDomainHeader\fR(\fIfileID, labelPtr, headerPtr\fR)
  110. .VS
  111. Ofs_SummaryInfo *
  112. \fBDisk_ReadSummaryInfo\fR(\fIfileID, labelPtr\fR)
  113. int
  114. \fBDisk_WriteSummaryInfo\fR(\fIfileID, labelPtr, summaryPtr\fR)
  115. .VE
  116. .VE
  117. int
  118. \fBDisk_SectorRead\fR(\fIfileID, index, count, buffer\fR)
  119. int
  120. \fBDisk_SectorWrite\fR(\fIfileID, index, count, buffer\fR)
  121. int
  122. \fBDisk_BlockRead\fR(\fIfileID, headerPtr, index, count, buffer\fR)
  123. int
  124. \fBDisk_BlockWrite\fR(\fIfileID, headerPtr, index, count, buffer\fR)
  125. int
  126. \fBDisk_BadBlockRead\fR(\fIfileID, headerPtr, index, buffer\fR)
  127. int
  128. \fBDisk_FragRead\fR(\fIfileID, headerPtr, index, count, buffer\fR)
  129. int
  130. \fBDisk_FragWrite\fR(\fIfileID, headerPtr, index, count, buffer\fR)
  131. void
  132. \fBDisk_PrintDomainHeader\fR(\fIheaderPtr\fR)
  133. void
  134. \fBDisk_PrintSummaryInfo\fR(\fIsummaryPtr\fR)
  135. .VS
  136. \fBDisk_PrintLabel\fR(\fIlabelPtr\fR)
  137. .VE
  138. void
  139. \fBDisk_PrintFileDescBitmap\fR(\fIheaderPtr, bitmap\fR)
  140. void
  141. \fBDisk_PrintDataBlockBitmap\fR(\fIheaderPtr, bitmap\fR)
  142. void
  143. \fBDisk_PrintDirEntry\fR(\fIdirEntryPtr\fR)
  144. .VS
  145. int
  146. \fBDisk_HasFilesystem\fR(\fIfileID, labelptr\fR)
  147. LfsSuperBlock*
  148. \fBDisk_ReadLfsSuperBlock\fR(\fIfileId, labelPtr\fR)
  149. ReturnStatus
  150. \fBDisk_WriteLfsSuperBlock\fR(\fIfileId, lfsSuperPtr\fR)
  151. LfsCheckPointHdr*
  152. \fBDisk_ReadLfsCheckPointHdr\fR(\fIfileId, labelPtr, areaPtr\fR)
  153. ReturnStatus
  154. \fBDisk_WriteLfsCheckPointHdr\fR(\fIfileId, headerPtr, area, labelPtr\fR)
  155. ReturnStatus
  156. \fBDisk_WriteLfsCheckPointArea\fR(\fIfileId, headerPtr, area, labelPtr\fR)
  157. LfsCheckPointTrailer*
  158. \fBDisk_LfsCheckPointTrailer\fR(\fIcheckPointHdrPtr\fR)
  159. ReturnStatus
  160. \fBDisk_ForEachCheckPointRegion\fR(\fIcheckPointHdrPtr, regionProc\fR)
  161. void
  162. \fBDisk_PrintLfsSuperBlockHdr\fR(\fIlfsSuperHdrPtr\fR)
  163. void
  164. \fBDisk_PrintLfsStableMemParams\fR(\fIstableMemPtr\fR)
  165. void
  166. \fBDisk_PrintLfsDescMapParams\fR(\fIdescMapPtr\fR)
  167. void
  168. \fBDisk_PrintLfsSegUsageParams\fR(\fIsegUsagePtr\fR)
  169. void
  170. \fBDisk_PrintLfsFileLayoutParams\fR(\fIfileLayoutPtr\fR)
  171. void
  172. \fBDisk_PrintLfsSuperBlock\fR(\fIlfsSuperPtr\fR)
  173. void
  174. \fBDisk_PrintLfsCheckPointHdr\fR(\fIcheckPointHdr\fR)
  175. void
  176. \fBDisk_PrintLfsCheckPointRegion\fR(\fIregionPtr\fR)
  177. void
  178. \fBDisk_PrintLfsCheckPointTrailer\fR(\fItrailerPtr\fR)
  179. .VE
  180. .SH ARGUMENTS
  181. .AS Ofs_DomainHeader blockNumber
  182. .AP int fileID in
  183. File descriptor from \fBopen\fP of raw disk.
  184. .AP int partition in
  185. Index of partition to access, 0-7.
  186. .VS
  187. .AP Disk_Label *labelPtr in
  188. Basic disk information from \fBDisk_ReadLabel\fP.
  189. .AP Disk_NativeLabelType labelType in
  190. Type of machine-specific (native) disk label on the disk.
  191. .AP Dec_DiskLabel *decLabelPtr
  192. Native disk label for ds3100s.
  193. .AP Sun_DiskLabel *sunLabelPtr
  194. Native disk label for Suns.
  195. .VE
  196. .AP int index in
  197. Index of first (sector/block/fragment) to transfer.
  198. .AP int count in
  199. Number of (sectors/blocks/fragments) to transfer.
  200. .AP char *buffer in
  201. Buffer for data transferred.
  202. .AP Ofs_DomainHeader *headerPtr in
  203. Disk header information from \fBDisk_ReadDiskHeader\fP.
  204. .AP Ofs_SummaryInfo *summaryPtr in
  205. Disk summary information sector.
  206. .AP char *bitmap in
  207. Array of bitmap bytes.
  208. .AP Fslcl_DirEntry *dirEntryPtr in
  209. Directory entry structure.
  210. .AP LfsSuperBlock *lfsSuperPtr in
  211. LFS Super Block structure.
  212. .AP LfsSuperBlockHdr *lfsSuperHdrPtr in
  213. Static parameters describing LFS layout on disk.
  214. .AP LfsCheckPointHdr *checkPointHdrPtr in
  215. Structure describing and heading a LFS checkpoint area.
  216. .AP int areaPtr out
  217. If non-NULL, returns the checkpoint the header is for.
  218. .AP int area in
  219. Flag determining the checkpoint area (0 or 1).
  220. .AP LfsCheckPointTrailer *trailerPtr in
  221. Structure capping a LFS checkpoinit area.
  222. .AP int\ proc(LfsCheckPointRegion*) regionProc in
  223. Procedure used to iterate over the various checkpoint regions
  224. between the lfsCheckPointHdr and the lfsChecpointTrailer.
  225. .AP LfsStableMemParams *stableMemPtr in
  226. Configuration parameters for stable memory data structures.
  227. .AP LfsDescMapParams *descMapPtr in
  228. LFS descriptor map layout on disk.
  229. .AP LfsSegUsageParams *segUsagePtr in
  230. LFS segment usage array layout description on disk.
  231. .AP LfsFileLayoutParams *fileLayoutPtr in
  232. Number of file descriptors to pack together per block.
  233. .BE
  234.  
  235. .SH INTRODUCTION
  236. .PP
  237. The \fBDisk\fP package is used to read and write raw disks that
  238. are formatted to contain Sprite file systems.  To use these routines correctly
  239. it is important to understand disk \fIpartitions\fP,
  240. file system \fIheader information\fP,
  241. file system \fIblocks\fP, and file system block \fIfragments\fP.
  242. .PP
  243. Each physical disk is divided into as many as 8 partitions.
  244. The letters 'a' through 'h' are used to distinguish these different
  245. partitions in the names of the special device files that are
  246. used to access them.  Thus ``/dev/rsd0a'' references the first (zero'th)
  247. partition on disk \fBrsd0\fP.  
  248. .VS
  249. The partitioning information is stored on the disk in the 
  250. ``disk label''.
  251. This label is in a machine-dependent format, and is referred to as
  252. the ``native disk label''.
  253. Native disk labels are kept in a machine-dependent
  254. location on the disk. 
  255. This is usually in sector 0 or some other sector near
  256. the start of the first partition.
  257. The
  258. \fBfsmake\fP program also
  259. copies the label to a partition when it formats
  260. it into a file system.  
  261. The routines \fBDisk_ReadSunLabel\fP and \fBDisk_ReadDecLabel\fP
  262. can be used to read the native disk labels.
  263. .PP
  264. It is not always convenient to deal with native disk labels.
  265. For this reason a generic label type and associated routines have been
  266. provided.
  267. The type \fBDisk_Label\fR is a standard format for disk labels.
  268. The routine \fBDisk_ReadLabel\fR is used to read a native disk label
  269. off the disk and convert it into a \fBDisk_Label\fR.
  270. The routine \fBDisk_WriteLabel\fR will convert a \fBDisk_Label\fR
  271. into a native disk label and write it on the disk.
  272. Two more procedures are provided for manipulating disk labels.
  273. \fBDisk_EraseLabel\fR will erase a native disk label from the disk,
  274. and \fBDisk_NewLabel\fR is used to create a new label if the disk does not
  275. have one already.
  276. The contents of a \fBDisk_Label\fR are defined in <disk.h>.
  277. .VE
  278. .PP
  279. \fBDisk_HasFilesystem\fR returns the type of file system on the
  280. disk.  If the disk has a LFS file system, DISK_HAS_LFS is returned;
  281. if the disk has an OFS file system, DISK_HAS_OFS is returned;
  282. otherwise, DISK_HAS_NO_FS is returned.
  283. .PP
  284. The detailed structure of the old sprite file system is defined by a
  285. Ofs_DomainHeader structure that is located on the disk according to the
  286. \fBDisk_Label\fP.  This can be obtained with the
  287. \fBDisk_ReadDomainHeader\fP procedure.  The Ofs_DomainHeader structure
  288. is defined in <kernel/fsdm.h>, and is passed to the block and fragment
  289. I/O routines so they can correctly locate blocks and fragments.
  290. .PP
  291. .VS
  292. A secondary data structure called the summary information is kept on disk
  293. following the domain header.
  294. The summary information consists of a single sector and contains such
  295. information as the number of free blocks and file descriptors.
  296. The Ofs_SummaryInfo structure is defined in <kernel/fsdm.h>.
  297. The location of the summary sector is stored in the \fBDisk_Label\fR.
  298. The summary sector can be read and written using the 
  299. \fBDisk_ReadSummaryInfo\fR and \fBDisk_WriteSummaryInfo\fR procedures.
  300. .PP
  301. The detailed structure of a log structured file system is defined
  302. by a LfsSuperBlock structure whose location on disk is determined
  303. in <kernel/lfsSuperBlock.h>.  This structure can be read off of
  304. a disk using \fBDisk_ReadLfsSuperBlock\fR, and written using
  305. \fBDisk_WriteSuperBlock\fR.
  306. .PP
  307. \fBDisk_ReadLfsCheckpointHdr\fR returns the current LFS checkpoint
  308. header, which is also a front for the current checkpoint area
  309. whose bulk is hidden behind the \fBLfsCheckPointHdr\fR. If \fBareaPtr\fR
  310. is non-NULL, the area number that the header is for gets returned
  311. through the pointer.  (The area can be either zero or one, and only
  312. makes a difference if the checkpoint header is going to be written
  313. back out to disk.)
  314. \fBDisk_CheckPointTrailer\fR accesses the tail of the checkpoint
  315. area from a \fBLfsCheckPointHdr\fR returned from 
  316. \fBDisk_ReadLfsCheckPointHdr\fR. \fBDisk_WriteLfsCheckPointHdr\fR
  317. will write to disk only the \fBLfsCheckPointHdr\fR structure of the
  318. specified checkpoint area; \fBDisk_WriteLfsCheckPointArea\fR will
  319. write to disk the entire checkpoint area headed by a \fBLfsCheckPointHdr\fR,
  320. which is larger than just the structure itself (such as is returned
  321. by \fBDisk_ReadLfsCheckPointHdr\fR).
  322. \fBDisk_ForEachCheckPointRegions\fR takes a procedural argument
  323. and iterates over the \fBLfsCheckPointRegions\fR in the checkpoint area
  324. headed by a \fBLfsCheckPointHdr\fR, applying the procedural argument to
  325. every region in the checkpoint area.  If the procedure returns a
  326. non-zero value, then the iteration halts and that value is returned
  327. from \fBDisk_ForEachCheckPointRegion\fR.
  328. .SH "SECTOR I/O"
  329. .PP
  330. \fBDisk_SectorRead\fP and \fBDisk_SectorWrite\fP read and write sectors
  331. from the disk without regard to the underlying block structure.  Their
  332. \fIindex\fP argument specifies the first sector (starting from zero)
  333. to transfer, relative to the start of the partition.  The sector
  334. offsets given in the \fBDisk_Label\fP structure are useful with
  335. this routine.
  336. .SH "BLOCK I/O"
  337. .PP
  338. The file system is arranged in block-sized chunks on the disk.
  339. \fBFS_BLOCK_SIZE\fP defines how many bytes this is (currently 4 Kbytes).
  340. Due to disk geometry considerations consecutive blocks may or may not
  341. be contiguous on disk.  \fBDisk_BlockRead\fP and \fBDisk_BlockWrite\fP
  342. use geometry and block layout information in the Ofs_DomainHeader to
  343. correctly locate disk blocks.  The \fIindex\fP argument to these routines
  344. is a block index, counting from the beginning of the partition
  345. (see the warning below!).
  346. .PP
  347. \fBDisk_BadBlockRead\fP is used to re-read a bad file system block and
  348. determine which sectors are bad.  It returns a bitmask with bits
  349. set to indicate which of the sectors were successfully read.
  350. Bit \fIi\fP in the mask corresponds
  351. to sector \fIi\fP in the block.  \fBDISK_SECTORS_PER_BLOCK\fP defines
  352. how many sector there are in each file system block.
  353. .SH "FRAGMENT I/O"
  354. .PP
  355. Each file system block is sub-divided into fragments to optimize allocation
  356. of small files.  Currently the fragment size is 1 Kbyte, so there are
  357. 4 fragments to each block.
  358. \fBDisk_FragRead\fP and \fBDisk_FragWrite\fP
  359. are used to read and write fragments.
  360. The \fIindex\fP argument to these routines
  361. is a fragment index, counting from the beginning of the partition
  362. (see the warning below!).  The \fIcount\fP argument to these routines
  363. should not be greater than the number of fragments per file system block.
  364. .SH "BLOCK AND FRAGMENT INDEXES"
  365. \fBWARNING:\fP there are several caveats about block numbers and
  366. fragment numbers as used by the Sprite file system.
  367. A partition is divided into areas for bitmaps, file descriptors,
  368. and data blocks.  These divisions are specified in the Ofs_DomainHeader
  369. structure in terms of block offsets and number of blocks.
  370. However, \fIblock numbers are not kept in disk maps, only fragment numbers\fP.
  371. When traversing the direct and indirect blocks that define where
  372. a file's blocks are, fragment indexes must be converted to block
  373. indexes before using either \fBDisk_BlockRead\fP or \fBDisk_BlockWrite\fP.
  374. Also, \fIdirect block pointers in the maps are fragment indexes
  375. relative to the start of the data block area of the file system\fP.
  376. Thus to convert from a direct block pointer to a physical fragment index:
  377. .DS
  378. fragIndex = blockPointer + (headerPtr->dataOffset * FS_FRAGMENTS_PER_BLOCK);
  379. blockIndex = fragIndex / FS_FRAGMENTS_PER_BLOCK;
  380. .DE
  381. .PP
  382. The last main caveat is that \fIindirect block pointers are
  383. physical fragment indexes\fP.  They do not need to be offset in the
  384. same way as direct block pointers.  This applies to any block pointer
  385. that points to an indirect block, never to a block pointer that points
  386. to a data block.
  387. .SH "PRINTING UTILITIES"
  388. .PP
  389. The last set of procedures in this package are used to print
  390. out contents of the file system.  \fBDisk_PrintDomainHeader\fP
  391. prints out the domain header information.
  392. \fBDisk_PrintSummaryInfo\fP prints out the summary disk sector.
  393. This sector is used to keep the prefix under which the disk is
  394. exported, the current number of blocks allocated and free,
  395. and whether or not the disk was safely sync'ed at last reboot.
  396. \fBDisk_PrintFileDescBitmap\fP and \fPDisk_PrintDataBlockBitmap\fP
  397. print out the file descriptor and data block bitmaps in hex.
  398. A zero bit represents a free descriptor or block.
  399. \fBDisk_PrintDirEntry\fP prints out a directory entry.
  400. \fBDisk_PrintLfsSuperBlock\fP prints out the contents of a
  401. LFS Super Block structure.
  402. \fBDisk_PrintLfsSuperBlockHdr\fP prints out the
  403. static parameters describing the LFS layout on disk.
  404. \fBDisk_PrintLfsCheckPointHdr\fP prints out the
  405. structure describing and heading a LFS checkpoint area.
  406. \fBDisk_PrintLfsCheckPointTrailer\fP prints out the
  407. structure capping a LFS checkpoinit area.
  408. \fBDisk_PrintLfsStableMemParams\fP prints out the
  409. configuration parameters for LFS stable memory data structures.
  410. \fBDisk_PrintLfsDescMapParams\fP prints out the
  411. LFS descriptor map layout on disk.
  412. \fBDisk_PrintLfsSegUsageParams\fP prints out the
  413. LFS segment usage array layout description on disk.
  414. \fBDisk_PrintLfsFileLayoutParams\fP prints out the
  415. number of file descriptors packed together per block.
  416. .SH SEE ALSO
  417. fscheck, fsmake, labeldisk, installboot
  418. .SH KEYWORDS
  419. disk, block, sector, fragment
  420.  
  421. @
  422.  
  423.  
  424. 1.7
  425. log
  426. @updated man page to explain the LFS checkpoint header and area write routines
  427. @
  428. text
  429. @d9 1
  430. a9 1
  431. '\" $Header: /sprite/src/lib/disk/RCS/Disk.man,v 1.6 91/09/14 15:17:15 mendel Exp Locker: voelker $ SPRITE (Berkeley)
  432. d93 1
  433. a93 1
  434. \fBDisk_ReadLfsCheckPointHdr\fR(\fIfileId, labelPtr\fR)
  435. d157 2
  436. d250 5
  437. a254 1
  438. whose bulk is hidden behind the \fBLfsCheckPointHdr\fR. 
  439. @
  440.  
  441.  
  442. 1.6
  443. log
  444. @Changes to reflect the old Sprite file system name being OFS and the
  445. addition of LFS.
  446. @
  447. text
  448. @d9 1
  449. a9 1
  450. '\" $Header: /sprite/src/lib/c/disk/RCS/Disk.man,v 1.5 90/03/18 12:54:01 jhh Exp Locker: mendel $ SPRITE (Berkeley)
  451. d16 2
  452. a17 1
  453. Disk_ReadLabel, Disk_WriteLabel, Disk_EraseLabel, Disk_NewLabel,Disk_ReadDecLabel, Disk_WriteDecLabel, Disk_ReadSunLabel,  Disk_WriteSunLabel, Disk_ReadDomainHeader, Disk_WriteDomainHeader, Disk_ReadSummaryInfo, Disk_WriteSummaryInfo, Disk_SectorRead, Disk_SectorWrite, Disk_BlockRead, Disk_BlockWrite, Disk_BadBlockRead, Disk_FragRead, Disk_FragWrite, Disk_PrintDomainHeader, Disk_PrintSummaryInfo, Disk_PrintFileDescBitmap, Disk_PrintDataBlockBitmap, Disk_PrintDirEntry, Disk_PrintLabel \- Package for accessing OFS file systems via raw disks
  454. a23 1
  455.  
  456. d85 36
  457. a120 1
  458.  
  459. d151 21
  460. d218 11
  461. a228 6
  462. The detailed structure of the file system is defined by a Ofs_DomainHeader
  463. structure that located on the disk according to the \fBDisk_Label\fP.
  464. This can be obtained with the \fBDisk_ReadDomainHeader\fP procedure.
  465. The Ofs_DomainHeader structure is defined in <kernel/fsdm.h>,
  466. and is passed to the block and fragment I/O routines so they can
  467. correctly locate blocks and fragments.
  468. d239 24
  469. a262 1
  470. .VE
  471. d335 16
  472. @
  473.  
  474.  
  475. 1.5
  476. log
  477. @Disk_Label rather than Disk_Info
  478. @
  479. text
  480. @d9 1
  481. a9 1
  482. '\" $Header: /sprite/src/lib/c/disk/RCS/Disk.man,v 1.4 90/02/16 16:08:51 shirriff Exp Locker: jhh $ SPRITE (Berkeley)
  483. d16 1
  484. a16 1
  485. Disk_ReadLabel, Disk_WriteLabel, Disk_EraseLabel, Disk_NewLabel,Disk_ReadDecLabel, Disk_WriteDecLabel, Disk_ReadSunLabel,  Disk_WriteSunLabel, Disk_ReadDomainHeader, Disk_WriteDomainHeader, Disk_ReadSummaryInfo, Disk_WriteSummaryInfo, Disk_SectorRead, Disk_SectorWrite, Disk_BlockRead, Disk_BlockWrite, Disk_BadBlockRead, Disk_FragRead, Disk_FragWrite, Disk_PrintDomainHeader, Disk_PrintSummaryInfo, Disk_PrintFileDescBitmap, Disk_PrintDataBlockBitmap, Disk_PrintDirEntry, Disk_PrintLabel \- Package for accessing file systems via raw disks
  486. d47 1
  487. a47 1
  488. Fsdm_DomainHeader *
  489. d52 1
  490. a52 1
  491. Fsdm_SummaryInfo *
  492. d87 1
  493. a87 1
  494. .AS Fsdm_DomainHeader blockNumber
  495. d108 1
  496. a108 1
  497. .AP Fsdm_DomainHeader *headerPtr in
  498. d110 1
  499. a110 1
  500. .AP Fsdm_SummaryInfo *summaryPtr in
  501. d162 1
  502. a162 1
  503. The detailed structure of the file system is defined by a Fsdm_DomainHeader
  504. d165 1
  505. a165 1
  506. The Fsdm_DomainHeader structure is defined in <kernel/fsdm.h>,
  507. d174 1
  508. a174 1
  509. The Fsdm_SummaryInfo structure is defined in <kernel/fsdm.h>.
  510. d193 1
  511. a193 1
  512. use geometry and block layout information in the Fsdm_DomainHeader to
  513. d219 1
  514. a219 1
  515. and data blocks.  These divisions are specified in the Fsdm_DomainHeader
  516. @
  517.  
  518.  
  519. 1.4
  520. log
  521. @Added Dec label documentation.
  522. @
  523. text
  524. @d9 1
  525. a9 1
  526. '\" $Header: /sprite/src/lib/c/disk/RCS/Disk.man,v 1.3 90/01/31 17:06:03 jhh Exp Locker: shirriff $ SPRITE (Berkeley)
  527. d15 3
  528. a17 1
  529. Disk_ReadDecLabel, Disk_ReadSunLabel, Disk_ReadDiskInfo, Disk_ReadDomainHeader, Disk_SectorRead, Disk_SectorWrite, Disk_BlockRead, Disk_BlockWrite, Disk_BadBlockRead, Disk_FragRead, Disk_FragWrite, Disk_PrintDomainHeader, Disk_PrintSummaryInfo, Disk_PrintFileDescBitmap, Disk_PrintDataBlockBitmap, Disk_PrintDirEntry \- Package for accessing file systems via raw disks
  530. d20 3
  531. a22 1
  532. #include <diskUtils.h>
  533. d25 10
  534. d37 2
  535. d42 5
  536. a46 2
  537. Disk_Info *
  538. \fBDisk_ReadDiskInfo\fR(\fIfileID, partition\fR)
  539. d48 3
  540. a50 1
  541. \fBDisk_ReadDomainHeader\fR(\fIfileID, diskInfoPtr\fR)
  542. d53 1
  543. a53 1
  544. \fBDisk_ReadSummaryInfo\fR(\fIfileID, diskInfoPtr\fR)
  545. d55 1
  546. a55 1
  547. \fBDisk_WriteSummaryInfo\fR(\fIfileID, diskInfoPtr, summaryPtr\fR)
  548. d57 1
  549. d76 3
  550. d92 10
  551. a101 2
  552. .AP Disk_Info *diskInfoPtr in
  553. Basic disk information from \fBDisk_ReadDiskInfo\fP.
  554. d130 31
  555. a160 31
  556. partition on disk \fBrsd0\fP.  The partitioning information is kept on
  557. the zero'th sector of the first partition, and \fBfsmake\fP also
  558. copies this to the first sector of a partition when it formats
  559. it into a file system.  The procedure \fBDisk_ReadSunLabel\fP is used
  560. to read this label sector for sun-compatible disks, and the format is
  561. defined in <kernel/devDiskLabel.h>.  The procedure \fBDisk_ReadDecLabel\fP
  562. is used to read this label sector for Dec-compatible disks.  Note that
  563. the label format used is an extension of the standard Dec format.
  564. .PP
  565. The first cylinder of each partition is reserved for file system header
  566. information.  This includes information about the geometry of the disk,
  567. the file descriptors, the block allocation bitmap, etc.  The location
  568. of the different pieces of header information can be obtained with
  569. the procedure \fBDisk_ReadDiskInfo\fP.  (Note that this procedure takes
  570. a partition index as well as an open file descriptor for that partition.)
  571. It returns the following structure:
  572. .DS
  573. .ta 2.5i
  574. typedef struct Disk_Info {
  575.     int firstCylinder;    /* First physical cylinder of the partition */
  576.     int numCylinders;    /* Number of cylinders in the partition */
  577.     int numHeads;    /* Number of heads on the disk */
  578.     int numSectors;    /* Number of sectors per track */
  579.     int domainSector;    /* Sector offset of Fsdm_DiskHeader information */
  580.     int numDomainSectors;    /* Size of the Fsdm_DiskHeader information */
  581.     int bootSector;    /* Sector offset of boot program */
  582.     int numBootSectors;    /* Size of the boot program */
  583.     int summarySector;    /* Sector offset of the summary sector */
  584.     char asciiLabel[128];    /* Copy of ascii disk label */
  585. } Disk_Info;
  586. .DE
  587. d163 1
  588. a163 1
  589. structure that located on the disk according to the \fBDisk_Info\fP.
  590. d175 1
  591. a175 1
  592. The location of the summary sector is stored in the \fBDisk_Info\fR.
  593. d185 1
  594. a185 1
  595. offsets given in the \fBDisk_Info\fP structure are useful with
  596. @
  597.  
  598.  
  599. 1.3
  600. log
  601. @added routines to read and write summary info
  602. @
  603. text
  604. @d9 1
  605. a9 1
  606. '\" $Header: /sprite/src/lib/c/disk/RCS/Disk.man,v 1.2 89/09/25 12:32:41 jhh Exp Locker: jhh $ SPRITE (Berkeley)
  607. d15 1
  608. a15 1
  609. Disk_ReadSunLabel, Disk_ReadDiskInfo, Disk_ReadDomainHeader, Disk_SectorRead, Disk_SectorWrite, Disk_BlockRead, Disk_BlockWrite, Disk_BadBlockRead, Disk_FragRead, Disk_FragWrite, Disk_PrintDomainHeader, Disk_PrintSummaryInfo, Disk_PrintFileDescBitmap, Disk_PrintDataBlockBitmap, Disk_PrintDirEntry \- Package for accessing file systems via raw disks
  610. d20 4
  611. d102 3
  612. a104 1
  613. defined in <kernel/devDiskLabel.h>.
  614. @
  615.  
  616.  
  617. 1.2
  618. log
  619. @Conforms to new fs module structure
  620. @
  621. text
  622. @d9 1
  623. a9 1
  624. '\" $Header: /sprite/src/lib/c/disk/RCS/Disk.man,v 1.1 89/02/09 11:14:09 brent Exp Locker: jhh $ SPRITE (Berkeley)
  625. d26 3
  626. d30 3
  627. d129 11
  628. @
  629.  
  630.  
  631. 1.1
  632. log
  633. @Initial revision
  634. @
  635. text
  636. @d9 1
  637. a9 1
  638. '\" $Header: /sprite/lib/forms/RCS/proto.man,v 1.5 89/01/27 08:36:02 ouster Exp $ SPRITE (Berkeley)
  639. d24 1
  640. a24 1
  641. FsDomainHeader *
  642. d52 1
  643. a52 1
  644. .AS FsDomainHeader blockNumber
  645. d65 1
  646. a65 1
  647. .AP FsDomainHeader *headerPtr in
  648. d67 1
  649. a67 1
  650. .AP FsSummaryInfo *summaryPtr in
  651. d71 1
  652. a71 1
  653. .AP FsDirEntry *dirEntryPtr in
  654. d108 2
  655. a109 2
  656.     int domainSector;    /* Sector offset of FsDiskHeader information */
  657.     int numDomainSectors;    /* Size of the FsDiskHeader information */
  658. d117 1
  659. a117 1
  660. The detailed structure of the file system is defined by a FsDomainHeader
  661. d120 1
  662. a120 1
  663. The FsDomainHeader structure is defined in <kernel/fsDisk.h>,
  664. d137 1
  665. a137 1
  666. use geometry and block layout information in the FsDomainHeader to
  667. d163 1
  668. a163 1
  669. and data blocks.  These divisions are specified in the FsDomainHeader
  670. @
  671.